package com.crm.service.cluePoolManager;

import com.crm.model.entity.cluePoolManager.CluePoolCompany;
import com.crm.model.entity.cluePoolManager.CluePoolCompanyExample;
import com.crm.model.qo.cluePoolManager.CluePoolOpenSeaQO;
import com.crm.model.vo.cluePoolManager.CluePoolCompanyOpenSeaVO;
import com.crm.model.vo.cluePoolManager.CluePoolPubliclOpenSeaVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author yincuimei
 * @Date 2020/12/24 11:13
 */
public interface CluePoolCompanyDbService {

    /**
     * 新增线索池公司表
     * @param cluePoolCompany
     * @return
     */
    Boolean insertCluePoolCompany(CluePoolCompany cluePoolCompany);

    /**
     * 私有池查询使用组人员
     * @param cluePollId   ---线索池主键
     * @param deleteStatus ---删除状态
     * @return
     */
    List<Map<String, Object>> selectPersonByDistributePermission(String cluePollId,Short deleteStatus);

    /**
     * 私有池查询使用组公司
     * @param cluePollId   ---线索池主键
     * @param deleteStatus ---删除状态
     * @return
     */
    List<Map<String, Object>> selectCompanyByDistributePermission(String cluePollId, Short deleteStatus);


    /**
     * 根据线索池id和公司id和使用人id查询线索池公司信息
     */
    CluePoolCompany selectByCluePoolIdAndCompanyIdAndUserPeopleId(String cluePoolId,String companyId,String userPeopleId,String permissionType);

    List<CluePoolCompany> selectByExample(CluePoolCompanyExample cluePoolCompanyExample);

    /**
     * 线索池id删除线索池使用权限
     * @param poolId
     * @return
     */
    Boolean updatePoolCompany(String poolId,String permissionType);

    /**
     * 权限与详情-查询公司使用组列表
     * @param cluePollId
     * @param permissionType
     * @return
     */
    List<CluePoolCompany>  selectByCluePoolIdAndPermissionType(String cluePollId, String permissionType);

}
